﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace UIT_CV_Management
{
    public partial class UserControlBaoCaoCanBo : UserControl
    {
        bool isEveryThingOK = false;
        bool isTenBaoCaoOK = false;

        public String TenBaoCao;

        
        public UserControlBaoCaoCanBo()
        {
            InitializeComponent();
            this.hideAll();
        }

        private void hideAll()
        {
            pictureBoxTenBaoCao.Visible = false;
        }
        public bool isBaoCaoCanBoOK()
        {
            this.txbTenBaoCao_Validating(txbTenBaoCao, null);

            isEveryThingOK = isTenBaoCaoOK;
            return isEveryThingOK;
        }

        private void txbTenBaoCao_Validating(object sender, CancelEventArgs e)
        {
            bool isHasError = false;

            if (txbTenBaoCao.Text.Trim() == "")
                isHasError = true;

            if (isHasError)
            {
                isTenBaoCaoOK = false;
                
                // change NoiSinh's background color to Tomato
                // Add UserTip
                txbTenBaoCao.BackColor = Color.Tomato;
                pictureBoxTenBaoCao.Visible = false;
            }
            else
            {
                isTenBaoCaoOK = true;
                txbTenBaoCao.BackColor = Color.White;
                pictureBoxTenBaoCao.Visible = true;
            }
        }
    }
}
